<?php
/**
 * Created by PhpStorm.
 * User: 11893
 * Date: 2018/11/15
 * Time: 15:29
 */

namespace Mars\PageCache;


use Illuminate\Support\ServiceProvider;
use Mars\PageCache\Drivers\FileCache;

class PageCacheProvider extends ServiceProvider
{
    public function register()
    {
        $this->app->singleton(Cache::class, function ($app) {
            $driver = new FileCache($app->make('files'));
            $cache = new Cache($driver->setApplication($app));
            return $cache->setContainer($app);
        });
    }

}